package net.lahuobao.mall.entity.admin;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.*;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**   
 * @Title: Entity
 * @Description: 文章分类
 * @author zhangdaihao
 * @date 2016-08-25 11:01:09
 * @version V1.0   
 *
 */
@Entity
@Table(name = "mall_article_category", schema = "lahuobao")
@DynamicUpdate(true)
@DynamicInsert(true)
@SuppressWarnings("serial")
public class MallArticleCategoryEntity implements java.io.Serializable {
	/**主键*/
	private java.lang.String id;
	/**分类名称*/
	private java.lang.String categoryname;
	/**上级分类*/
	private java.lang.String parentcategoryid;
	/**是否允许多篇文章*/
	private java.lang.Integer ismulty;

	/**分类类型*/
	private java.lang.String categorytype;

	//树子节点集合
	private List<MallArticleCategoryEntity> categorys = new ArrayList<MallArticleCategoryEntity>();

	private MallArticleCategoryEntity mallArticleCategoryEntity;

	/**
	 *方法: 取得java.lang.String
	 *@return: java.lang.String  主键
	 */
	
	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name ="ID",nullable=false,length=36)
	public java.lang.String getId(){
		return this.id;
	}

	/**
	 *方法: 设置java.lang.String
	 *@param: java.lang.String  主键
	 */
	public void setId(java.lang.String id){
		this.id = id;
	}
	/**
	 *方法: 取得java.lang.String
	 *@return: java.lang.String  分类名称
	 */
	@Column(name ="CATEGORYNAME",nullable=false,length=50)
	public java.lang.String getCategoryname(){
		return this.categoryname;
	}

	/**
	 *方法: 设置java.lang.String
	 *@param: java.lang.String  分类名称
	 */
	public void setCategoryname(java.lang.String categoryname){
		this.categoryname = categoryname;
	}
	/**
	 *方法: 取得java.lang.String
	 *@return: java.lang.String  上级分类
	 */
	@Column(name ="PARENTCATEGORYID",nullable=true,length=36)
	public java.lang.String getParentcategoryid(){
		return this.parentcategoryid;
	}

	/**
	 *方法: 设置java.lang.String
	 *@param: java.lang.String  上级分类
	 */
	public void setParentcategoryid(java.lang.String parentcategoryid){
		this.parentcategoryid = parentcategoryid;
	}
	/**
	 *方法: 取得java.lang.Object
	 *@return: java.lang.Object  是否允许多篇文章
	 */
	@Column(name ="ISMULTY",nullable=false,precision=1)
	public java.lang.Integer getIsmulty(){
		return this.ismulty;
	}

	/**
	 *方法: 设置java.lang.Object
	 *@param: java.lang.Object  是否允许多篇文章
	 */
	public void setIsmulty(java.lang.Integer ismulty){
		this.ismulty = ismulty;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "categorys")
	public List<MallArticleCategoryEntity> getCategorys() {
		return categorys;
	}

	public void setCategorys(List<MallArticleCategoryEntity> categorys) {
		this.categorys = categorys;
	}

	@OneToOne
	@JoinColumn(name = "parentcategoryid", insertable = false, updatable = false)
	public MallArticleCategoryEntity getMallArticleCategoryEntity() {
		return mallArticleCategoryEntity;
	}

	public void setMallArticleCategoryEntity(MallArticleCategoryEntity mallArticleCategoryEntity) {
		this.mallArticleCategoryEntity = mallArticleCategoryEntity;
	}

	@Column(name ="CATEGORYTYPE",nullable=false,length=50)
	public String getCategorytype() {
		return categorytype;
	}

	public void setCategorytype(String categorytype) {
		this.categorytype = categorytype;
	}
}
